# CMakeLists.txt for Native Camera Project
cmake_minimum_required(VERSION 3.18.1)

# 设置项目名称
project("nativecamera")

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 查找必需的库
find_library(log-lib log)
find_library(android-lib android)
find_library(camera2ndk-lib camera2ndk)
find_library(mediandk-lib mediandk)

# 添加源文件
add_library(
    nativecamera
    SHARED
    native_camera_manager.cpp
    jni_bridge.cpp
)

# 包含头文件目录
target_include_directories(nativecamera PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}
)

# 链接库
target_link_libraries(
    nativecamera
    ${log-lib}
    ${android-lib}
    ${camera2ndk-lib}
    ${mediandk-lib}
    ${atrace-lib}
)

# 设置编译选项
target_compile_options(nativecamera PRIVATE
    -Wall
    -Wextra
    -O2
)